package org.ikastola

import java.util.Date;

/**
 * Queda 1 a 1. Un recibo para cada alumno
 * 
 * @author mariano
 *
 */
class Receipt {

	List details
	List checks
	static hasMany = [details: ItemDetail, checks: PaymentCheck]
	Student student
//	Date paymentdate // fecha a la que corresponde el pago - lo tienen los items details
	Date creationdate // fecha de emision del comprobante //No va a UI
	Double total
	Double due //deuda generada en este recibo
	Integer status // No va a UI
	Integer istemp // indica si es provisorio o no //No va a UI
	Integer deleted
	String uuid
	Date classCreated
	Date classUpdated
	
    static constraints = {
		student nullable: false
		total blank: false
		//paymentdate blank: false
		creationdate blank: false
		status inList: [0, 1, 2] //0: pago, 1: pago parcialmente, 2: impago
		istemp inList: [0, 1] //0: no, 1: si
		deleted blank: false
		uuid blank: false
		classCreated nullable: true
		classUpdated nullable: true
    }
}
